package com.gsxi.tyagbackend.utils.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author: gsxi
 * @CreateTime: 2024-07-17
 * @Description: 业务异常
 * @Version: 1.0
 */

@EqualsAndHashCode(callSuper = true)
@Data
public class BizException extends RuntimeException{
    /**
     * 异常码
     */
    private Integer errorCode;
    /**
     * 错误信息
     */
    private String errorMessage;

    public BizException(BaseExceptionInterface baseExceptionInterface) {
        this.errorCode = baseExceptionInterface.getErrorCode();
        this.errorMessage = baseExceptionInterface.getErrorMessage();
    }
}
